﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Gmis.Web.Common
{
    public class Flv
    {
        private string _File;
        private int _Width;
        private int _Height;

        public int Width
        {
            set { _Width = value; }
        }

        public int Height
        {
            set { _Height = value; }
        }

        public string File
        {
            set { _File = value; }
        }

        public Flv()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Flv(int Width, int Height, string File)
        {
            this._Width = Width;
            this._Height = Height;
            this._File = File;
        }

        public string Player()
        {
            string texts = string.Empty;
            string config = "1:自动播放|0:连续播放|100:默认音量|0:控制栏位置|2:控制栏显示|0x000033:主体颜色|60:主体透明度|0x66ff00:光晕颜色|0xffffff:图标颜色|0xffffff:文字颜色|:logo文字|:logo地址|:结束swf地址";
            string swffile = HttpContext.Current.Request.ApplicationPath + "/flash/vcastr22.swf";

            return @"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width=" + _Width + " height=" + _Height + ">"
             + @" <param name='movie' value=" + swffile + ">"
             + @" <param name='quality' value='high'>"
             + @" <param name='menu' value='false'>"
             + @" <param name='wmode' value='opaque'>"
             + @" <param name='allowFullScreen' value='true'>"
             + @" <param name='FlashVars' value='vcastr_file=" + _File + "&vcastr_title=" + texts + "&vcastr_config=" + config + "'>"
             + @" <embed src=" + swffile + " wmode='opaque' FlashVars='vcastr_file=" + _File + "&vcastr_title=" + texts + "&vcastr_config=" + config + "' menu='false' quality='high' width=" + _Width + " height=" + _Height + " type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"
             + @" </object>";
        }
    }
}